#include "mygoalitem.h"
 #include <QStaticText>

myGoalItem::myGoalItem(QColor color,QString name)
{

    pcolor = color;
    pname = name;

}


QRectF myGoalItem::boundingRect() const
{
    return QRectF(-200,-200,400,400);
}

void myGoalItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{

    QRectF rec = boundingRect();

    QPen qpen(Qt::black);
    QBrush qbrush(pcolor);

    qpen.setWidth(5);

    painter->setPen(qpen);
    painter->setBrush(qbrush);

    QRectF rec_sqr = QRectF(-200,-200,400,400);
    painter->drawRect(rec_sqr);
    QPointF p1 = QPointF(0,-200);
    QPointF p2 = QPointF(0,-75);

    qpen.setWidth(18);

    painter->setPen(qpen);



    painter->drawLine(p1,p2);

    QFont pfont = painter->font();

    pfont.setPointSize(150);

    painter->setFont(pfont);


    painter->drawText(250,0,pname);

}
